package com.liusand.client.exception;

import com.liusand.model.vo.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author :liusha
 * packageName :com.liusand.client.exception
 * fileName :GlobalExceptionHandler
 * creationTime :2023/1/30 19:54
 */
@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(RuntimeException.class)
    public Result runtimeException(Exception e){
        e.printStackTrace();
        return Result.error(500,e.getMessage());
    }
}
